package com.niguang.work.api.weChatTemplate.vo;

import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 整改人或复查人微信通知模板内容
 */
@Data
public class ZhengGaiPersonVo {

    /**
     * 发送信息openId
     */
    private String openId;

    /**
     * 表单ID
     */
    private String contentId;

    /**
     * 标题
     */
    private String title;

    /**
     * 内容
     */
    private String content;

    /**
     * 消息类型
     */
    private String infoType;

    /**
     * 项目名称
     */
    private String siteName;

    /**
     * 隐患部位
     */
    private String dangerTitle;

    /**
     * 隐患级别
     */
    private String dangerLevelText;

    /**
     * 整改期限
     */
    private String reformTerm;

    /**
     * 上报人
     */
    private String submitUserName;

    /**
     * 指派人
     */
    private String applyUserName;

    /**
     * 时间
     */
    private String createTime;

    private String pageType;

    private String dangerContent;


    public ZhengGaiPersonVo() {
    }

    public ZhengGaiPersonVo(String openId, String contentId, String infoType, String siteName,
                            String dangerTitle, String dangerLevelText, String reformTerm, String submitUserName, String applyUserName, String dangerContent) {
        this.title = "隐患整改/复查提醒";
        this.openId = openId;
        this.contentId = contentId;
        this.infoType = infoType;
        this.siteName = siteName;
        this.dangerTitle = dangerTitle;
        this.dangerLevelText = dangerLevelText;
        this.reformTerm = reformTerm;
        this.createTime = getDate();
        this.pageType = "1";
        this.submitUserName = submitUserName;
        this.applyUserName = applyUserName;
        this.dangerContent = dangerContent;
    }

    private String getDate() {
        LocalDateTime ldt = LocalDateTime.now();
        DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        return dtf2.format(ldt);
    }


    public ZhengGaiPersonVo(String openId, String contentId, String dangerTitle, String reformTerm) {
        this.title = "您好，您有待整改/复查隐患工单逾期。";
        this.openId = openId;
        this.contentId = contentId;
        this.dangerTitle = dangerTitle;
        this.reformTerm = reformTerm;
    }
}
